package dev.html;
import java.net.*;
import java.io.*;

public class HTMLPage {
	
	public static String getPageAsString(String url){
		try {
			URL pageUrl = new URL(url);
			URLConnection yc = pageUrl.openConnection();
			BufferedReader in = new BufferedReader(
					new InputStreamReader(
							yc.getInputStream()));
			String inputLine;
			StringBuffer allPage = new StringBuffer();
			while ((inputLine = in.readLine()) != null) 
				allPage.append(inputLine);
			in.close();
			return allPage.toString();
		} catch (MalformedURLException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return "";
	}
	
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
